//
// Created by 123 on 2025/1/8.
//
#include "iostream"
#include "list"
using namespace std;

void printList(list<int>& li){
    for(list<int>::const_iterator it=li.begin();it!=li.end();it++){
        cout << *it << " ";
    }
    cout << endl;
}


bool myCompare(int val1,int val2){
    return val1>val2;
}

void test(){
    list<int> ls;
    ls.push_back(1);
    ls.push_back(2);
    ls.push_back(3);
    ls.push_back(0);
    printList(ls);

    ls.reverse();
    printList(ls);

//    ls.sort();
    ls.sort(myCompare);
    printList(ls);

    ls.reverse();
    printList(ls);
}

int main135(){
    test();
    return 0;
}